<template>
   
  <div>
    <el-table :data="roleList" style="width: 100%">
   
      <el-table-column prop="rolename" label="名称" width="180">
      </el-table-column>
      <el-table-column prop="status" label="状态" width="180">
        <template slot-scope="scope">
          {{scope.row}}
          <el-tag :type="scope.row.status == 1 ? 'success' : 'warning'">
            {{ scope.row.status == 1 ? "启用" : "禁用" }}
          </el-tag>
        </template>
      </el-table-column>
      <el-table-column label="操作">
        <template slot-scope="scope">
          <el-button size="mini" @click="handleEdit(scope.$index, scope.row)"
            >编辑</el-button
          >
          <el-button
            size="mini"
            type="danger"
            @click="handleDelete(scope.row.id)"
            >删除</el-button
          >
        </template>
      </el-table-column>
    </el-table>
  </div>
</template>

<script>
export default {
  props: ["roleList", "oppens"],
  data() {
    return {
     
    };
  },
  methods: {
    //编辑
    handleEdit(index, row) {
      console.log(index, row);
      this.$BUS.$emit('edit',row)
    },
    //删除
    handleDelete(id) {
      this.$emit('removes',id)
    },
  },
  created() {},
  mounted() {},
  components: {},
  computed: {},
  watch: {},
};
</script>

<style lang='scss' scoped>
</style>
